An enum can also declare functions. They need to appear after the declaration of the enum constants themselves, and the last such constant needs to have a trailing semicolon (;) before the function declarations begin.

You can learn more about this in:
Run Edit